#include <iostream>

using namespace std;

typedef void(*fun)(void);

class Base
{
public:
    virtual void printA(void)
    {
        cout << "A" << endl;
    }
    virtual void printB(void)
    {
        cout << "B" << endl;
    }
    virtual int printC(int a)
    {
        return a;
    }
public:
    int a;
};

class Chi:public Base
{
public:
    virtual void printB(void)
    {
        cout << "hello" << endl;
    }
};

int main(int argc, char **argv)
{
    Base *p = new Chi;

    long *vfptr = (long *)*(long *)p;

    fun op1 = (fun)vfptr[0];
    op1();
    fun op2 = (fun)vfptr[1];
    op2();

    cout << sizeof(Base) << endl;
    return 0;
}